package com.catmiao.ai.controller;

import dev.langchain4j.model.chat.ChatModel;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/api/llm/")
public class MultiModelController {

    @Resource(name = "qwen")
    private ChatModel chatModelQwen;

    @Resource(name = "deepseek")
    private ChatModel chatModelDeepSeek;

    @GetMapping("/chat/qwen")
    public String chatQwen(@RequestParam(defaultValue = "你是谁") String prompt){

        String chatResult = chatModelQwen.chat(prompt);

        log.debug("【result】：" + chatResult);

        return chatResult;
    }


    @GetMapping("/chat/deepSeek")
    public String chatDeepSeek(@RequestParam(defaultValue = "你是谁") String prompt){

        String chatResult = chatModelDeepSeek.chat(prompt);

        log.debug("【result】：" + chatResult);

        return chatResult;
    }
}
